using System;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "MultiGeometryType")]
    public class MultiGeometry : Geometry
	{
        private GeometryList gList;

        public MultiGeometry()
        {
            this.gList = new GeometryList();
        }

        [XmlElement(ElementName = "LineString", Type = typeof(LineString))]
        [XmlElement(ElementName = "LinearRing", Type = typeof(LinearRing))]
        [XmlElement(ElementName = "Model", Type = typeof(Model))]
        [XmlElement(ElementName = "MultiGeometry", Type = typeof(MultiGeometry))]
        [XmlElement(ElementName = "Point", Type = typeof(Point))]
        [XmlElement(ElementName = "Polygon", Type = typeof(Polygon))]
        public Geometry[] Items
        {
            get { return this.gList.ToArray(); }
            set { this.gList = new GeometryList(value); }
        }

        [XmlIgnore()]
        public GeometryList Geometries
        {
            get { return this.gList; }
        }
    }
}